using System;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.ComponentModel;
using System.ComponentModel.Design;
using AjaxControlToolkit;

[assembly: System.Web.UI.WebResource("RequiredFieldExtender.RequiredFieldExtenderBehavior.js", "text/javascript")]

//RequiredFieldExtender

namespace AJAXExtenders
{
    [Designer(typeof(RequiredFieldExtenderDesigner))]
    [ClientScriptResource("RequiredFieldExtender.RequiredFieldExtenderBehavior", "RequiredFieldExtender.RequiredFieldExtenderBehavior.js")]
    [TargetControlType(typeof(IValidator))]
    public class RequiredFieldExtender : ExtenderControlBase
    {
       
        [DefaultValue("")]
        [ExtenderControlProperty]
        [ClientPropertyName("TargetLabelID")]
        [ElementReference] 
        [RequiredProperty]
        [IDReferenceProperty(typeof(Label))] 
        public string TargetLabelID
        {
            get{ return GetPropertyValue("TargetLabelID", string.Empty); }
            set{ SetPropertyValue("TargetLabelID", value);}
        }

        [DefaultValue("")]
        [ExtenderControlProperty]
        [ClientPropertyName("InvalidTextBoxCssClass")]
        [RequiredProperty]
        public string InvalidTextBoxCssClass
        {
            get { return GetPropertyValue("InvalidTextBoxCssClass", string.Empty); }
            set { SetPropertyValue("InvalidTextBoxCssClass", value); }
        }

        [DefaultValue("")]
        [ExtenderControlProperty]
        [ClientPropertyName("InvalidLabelCssClass")]
        [RequiredProperty]
        public string InvalidLabelCssClass
        {
            get { return GetPropertyValue("InvalidLabelCssClass", string.Empty); }
            set { SetPropertyValue("InvalidLabelCssClass", value); }
        }
    }
}
